Skip to content

refactor: update Live API configuration, transcription support, and i…#1224

Merged
thorwebdev merged 1 commit into
mainfrom
thor/update-live-quickstart-python
May 28, 2026
Merged

refactor: update Live API configuration, transcription support, and i…#1224
thorwebdev merged 1 commit into
mainfrom
thor/update-live-quickstart-python

Conversation

@thorwebdev

Copy link
Copy Markdown
Collaborator

…nput handling for model version gemini-3.1-flash-live-preview

fixes #1108

…nput handling for model version gemini-3.1-flash-live-preview
@thorwebdev thorwebdev requested a review from Giom-V May 8, 2026 20:25
@github-actions github-actions Bot added status:awaiting review PR awaiting review from a maintainer component:quickstarts Issues/PR referencing quickstarts folder labels May 8, 2026
@thorwebdev thorwebdev requested a review from kkorpal May 8, 2026 20:25
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly updates the Get_started_LiveAPI.py quickstart example to leverage the latest gemini-3.1-flash-live-preview model. The changes primarily focus on adapting the client configuration and real-time input/output handling to incorporate new features like audio transcription and a more streamlined API for sending media blobs. This ensures the example remains compatible with the most recent API version and demonstrates enhanced interactive capabilities.

Highlights

  • Live API Configuration Update: The quickstart example has been updated to use the new gemini-3.1-flash-live-preview model, replacing the older gemini-2.5-flash-native-audio-preview-12-2025 model.
  • Transcription Support Enabled: Input and output audio transcription capabilities have been enabled within the LiveSession configuration, allowing for real-time text representation of spoken input and model responses.
  • Streamlined Input Handling: The methods for sending text, audio, and visual inputs have been refactored to align with the updated API, including the removal of base64 encoding for image data and the use of types.Blob for media inputs.
  • API Key Environment Variable Change: The environment variable for the API key has been updated from GEMINI_API_KEY to GOOGLE_API_KEY.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Live API quickstart to use the google-genai SDK (v1.0.0+), involving model and API key updates, enabling audio transcriptions, and refactoring the audio reception logic. The review feedback highlights several necessary corrections for SDK compatibility, such as the proper usage of send_realtime_input and send_client_content. Additionally, improvements were suggested regarding the repository's style guide for model selection, the use of constants for sample rates, and the handling of incremental transcription updates.

Comment thread quickstarts/Get_started_LiveAPI.py
Comment thread quickstarts/Get_started_LiveAPI.py
Comment thread quickstarts/Get_started_LiveAPI.py
Comment thread quickstarts/Get_started_LiveAPI.py
Comment thread quickstarts/Get_started_LiveAPI.py
@thorwebdev thorwebdev merged commit fcaac01 into main May 28, 2026
4 checks passed
@thorwebdev thorwebdev deleted the thor/update-live-quickstart-python branch May 28, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:quickstarts Issues/PR referencing quickstarts folder status:awaiting review PR awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live API does not perceive visual information and hallucinates

4 participants